# -*- coding:utf-8 -*-
class Solution:
    # 返回对应char
    def __init__(self):
        self.d = {}
        self.a = []
    def FirstAppearingOnce(self):
        # write code here
        while len(self.a) > 0 and self.d[self.a[0]] >= 2:
            self.a.pop(0)
        if len(self.a) == 0:
            return "#"
        else:
            return self.a[0]
    def Insert(self, char):
        # write code here
        if char not in self.d.keys():
            self.d[char] = 1
            self.a.append(char)
        else:
            self.d[char] = 2